#
# @lc app=leetcode.cn id=121 lang=python3
#
# [121] 买卖股票的最佳时机
#

# @lc code=start
class Solution:
    def maxProfit(self, prices: List[int]) -> int:
        minprice = int(1e9)
        maxpro=0
        for i in prices:
            minprice = min(i,minprice)
            maxpro = max(i-minprice,maxpro)
        return maxpro
# @lc code=end

